<!DOCTYPE html>
<html>
{include file="public/header" /}
<body>

<div class="layui-fluid" id="app">

    <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
        <ul class="layui-tab-title">
            <li onclick="go('index')" class="">轮播图</li>
            <li class="layui-this">新轮播图</li>

        </ul>
        <div class="layui-tab-content" style="padding-left: 0px;padding-right: 0px">

            <div class="layui-tab-item layui-show" style="margin-top: 15px">

                <form class="layui-form" action="" lay-filter="component-form-group">
                    <div class="layui-form-item">
                        <label class="layui-form-label">分组</label>
                        <div class="layui-input-block">
                            <input type="text" name="title" lay-verify="required" autocomplete="off"
                                   placeholder="请输入"
                                   class="layui-input">
                        </div>
                    </div>

                    <div class="layui-form-item form-footer2">
                        <div class="layui-input-block">
                            <button class="layui-btn" type="button" lay-submit="" lay-filter="component-form-demo1">立即提交</button>
                            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                        </div>
                    </div>


                </form>


                <!--<div class="layui-form-item">-->
                <!--<div class="layui-input-block">-->
                <!--<div class="layui-footer">-->
                <!--<button class="layui-btn" lay-submit="" lay-filter="component-form-demo1">立即提交</button>-->
                <!--<button type="reset" class="layui-btn layui-btn-primary">重置</button>-->
                <!--</div>-->
                <!--</div>-->
                <!--</div>-->
            </div>

        </div>
    </div>
</div>

<script>

    layui.use(['form', 'laydate'], function () {
        var $ = layui.$
            , element = layui.element
            , layer = layui.layer
            , laydate = layui.laydate
            , form = layui.form;


        /* 监听提交 */
        form.on('submit(component-form-demo1)', function (data) {

            $.post("{:url('add')}", data.field, function (res) {
                if (res.code == 1) {
                    parent.layer.msg(res.msg, {icon: 1})
                    go("{:url('index')}");
                    return false;
                } else {
                    parent.layer.msg(res.msg, {icon: 2})
                    return false;
                }
            });


            return false;
        });
    });
</script>

</body>
</html>










